import java.util.ArrayList;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        ArrayList<Integer> arrayList=new ArrayList<>();
        for (int i = 1; i <11 ; i++) {
            arrayList.add(i);
        }
        //1
        System.out.println(arrayList.size());
        //5
        for (int i = 0; i <arrayList.size() ; i++) {
            System.out.print(arrayList.get(i)+",");
        }
        System.out.println();
        for (int i = arrayList.size()-1; i >-1 ; i--) {
            System.out.print(arrayList.get(i)+",");
        }
        //3
        Scanner scanner=new Scanner(System.in);
        int needNum=scanner.nextInt();
        int changeNum=scanner.nextInt();
        for (int i = 0; i <arrayList.size() ; i++) {
            if (arrayList.get(i)==needNum){
                arrayList.set(i,changeNum);
            }
        }
    }
}
